let indexConfig = [
  {
    path: '/', 
    redirect:'/home',
    meta:{
      active:'home'
    }
    // component: '../../views/mine.vue', 
  },
  {
    path: '/home', 
    name:'home',
    component: () => import('@/views/home/home.vue'), 
    meta:{
      active:'home'
    }
  },
  {
    path: '/mine', 
    name:'mine',
    component: () => import('@/views/mine.vue'), 
    meta:{
      active:'mine'
    },
    beforeEnter: (to, from,next) => {
      // 判断是否登录
      if(!localStorage.getItem('token')){
        next('/login')
      }else{
        next()
      }
    },
  },
  {
    path: '/login', 
    name:'login',
    component: () => import('@/views/login.vue'), 
    meta:{
      active:'mine'
    },
  },
  {
    path: '/courier', 
    name:'courier',
    component: () => import('@/views/courier/courier.vue'), 
    meta:{
      active:'courier'
    }
  },
  {
    path: '/jokes', 
    name:'jokes',
    component: () => import('@/views/jokes/jokes.vue'), 
    meta:{
      active:'jokes'
    }
  },
  {
    path: '/story', 
    name:'story',
    component: () => import('@/views/story/story.vue'), 
    meta:{
      active:'story'
    }
  },
  {
    path: '/chat', 
    name:'chat',
    component: () => import('@/views/chat/chat.vue'), 
    meta:{
      active:'chat'
    }
  },
]
// 暴露出去一个route希望得到的路由结构
export default indexConfig